cmake_minimum_required(VERSION 3.0.2)
project(utilz C CXX)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

file(GLOB_RECURSE cpp_samples ${CMAKE_CURRENT_SOURCE_DIR} sample/*.cpp)
foreach(sample_filename ${cpp_samples})
  STRING(REGEX REPLACE ".+/(.+)\\..*" "\\1" file_name ${sample_filename})
  add_executable(${file_name} ${sample_filename})
  target_link_libraries(${file_name} pthread dl)
endforeach()

message(STATUS ${cpp_samples})
